home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
demos
/
rgb
/
unfold.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
3KB
|
134 lines
! True BASIC - Demo for Silicon Graphics
! uses doublebuffering and rgb-mode Gourard shading
CALL tw_wset_size(0,750,750)
call tw_wset_title(0,"unfold")
dim pts(3,2), clrs(3)
dim pts2(4,2), clrs2(4)
set mode "doublebuffer"
ask mode m$
if m$<>"DOUBLEBUFFER" then
set mode "text"
print "Doublebuffering only supported for Silicon Graphics GL version."
stop
end if
set mode "rgb"
clear
call swapbuffers(1)
set text justify "center","bottom"
set color mix (18) 172/255,0,1
! polygon vertices
let pts(1,1)=.1
let pts(1,2)=.1
let pts(2,1)=.9
let pts(2,2)=.1
let pts(3,1)=.5
let pts(3,2)=.9
! colors associated with vertices (does not effect mat plot)
let clrs(1)=2
let clrs(2)=3
let clrs(3)=4
! square
let pts2(1,1)=.35
let pts2(1,2)=.1
let pts2(2,1)=.65
let pts2(2,2)=.1
let pts2(3,1)=.65
let pts2(3,2)=.55
let pts2(4,1)=.35
let pts2(4,2)=.55
! colors associated with vertices (does not effect mat plot)
let clrs2(1)=2
let clrs2(2)=3
let clrs2(3)=4
let clrs2(4)=5
let n=setfont("Courier")
let n=setfontsize(30)
let n=setfontstyle("BoldOblique")
when error in
do
clear
draw hexagon
call swapbuffers(1)
set color "white"
pause 1
get mouse x,y,state
if state<>0 then stop
for i=0 to 2 step .05
clear
! True BASIC logo
draw logo1(.55)
draw hexagon with shift(-i,0)
draw hexagon with shift(0,-i)
draw hexagon with shift(i,i)
draw hexagon with rotate(i)
draw hexagon with shift(i,0)
draw hexagon with shift(0,i)
call swapbuffers(1)
next i
pause 1
get mouse x,y,state
if state<>0 then stop
call dropout
for i=1.3 to 0 step -.03
clear
draw hexagon with shift(-i,0)
draw hexagon with shift(i,i)
draw hexagon with rotate(i)
draw hexagon with shift(i,0)
draw hexagon with shift(0,i)
draw logo(i)
call swapbuffers(1)
next i
get mouse x,y,state
if state<>0 then stop
loop
use
set mode "text"
print extext$,exline$
end when
get key k
PICTURE hexagon
call gshade(pts,clrs)
END PICTURE
PICTURE logo1(y)
let pts2(3,2)=y
let pts2(4,2)=y
call gshade(pts2,clrs2)
plot text, at .5,y: "True BASIC"
END PICTURE
! text descends on screen decreasing its red intensity
sub dropout
for i=.55 to .05 step -.05
clear
set color mix(18) i,0,1
set color 18
draw logo1(i)
call swapbuffers(1)
next i
clear
draw logo(.5)
call swapbuffers(1)
set color "white"
end sub
! displays a logo using the red intensity "dr"
PICTURE logo(dr)
set color mix (18) dr,0,dr
set color 18
plot text, at .5,.05: "True BASIC"
END PICTURE
end